home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / CUGUK / PC_LIBS / C044.ZIP / ATIVGA.ZIP / SIMPLE.PAS < prev    next >
Pascal/Delphi Source File  |  1989-08-09  |  1KB  |  37 lines

  1. { Demonstrates:  Dynamically loaded BGI file. }
  2.  
  3. { Super VGA  BGI graphics driver }
  4. {        Thomas Design           }
  5. {        August 7, 1989          }
  6. {   Test routine                 }
  7.  
  8. uses
  9.   Graph,crt,ATIDET,VGAEXTRA;
  10.  
  11. var
  12.   Gd, Gm : integer;
  13.   count  : integer;
  14.   DAC    : RGB;                        { define the DAC array (type in TPU) }
  15.  
  16. begin
  17.   Gd := InstallUserDriver('ATI256',@_DetectATI256);  { must say   gd := Install...  to work }
  18.   Gd := DETECT;
  19.   InitGraph(Gd, gm ,'');
  20.   setgraphmode(ATI320x200);
  21.   DAC[0][0] := 0;                      { Demonstrate how to use dacpalette}
  22.   DAC[0][1] := 0;
  23.   DAC[0][2] := 0;
  24.   for count := 1 to 255 do begin
  25.       DAC[count][0] := random($3f);
  26.       DAC[count][1] := random($3f);
  27.       DAC[count][2] := random($3f);
  28.   end;
  29.   dacpalette(DAC);                  { load the DAC registers from array }
  30.   for Count := 1 to 2000 do begin      { Test the graphics mode }
  31.       SetColor(random(255));
  32.       line(getmaxx div 2,getmaxy div 2,random(getmaxx),random(getmaxy));
  33.   end;
  34.   restorecrtmode;
  35. end.
  36.  
  37.